<template>
  <div class="login">
    验证通过返回的UUID：{{uuid}}
    <button @click="handleLogin">
      <span>登 录</span>
    </button>

    <Captcha @close="close" :username="username" v-if="captchaVisible"/>

  </div>
</template>

<script>
import Captcha from '@/components/Captcha'
export default {
  name: "Login",
  components:{Captcha},
  data() {
    return {
      username: "admin",
      uuid:"",
      captchaVisible: false
    };
  },
  created() {
  },
  methods: {
    close(msg){
      this.captchaVisible = false;
      if(msg){
        this.uuid = msg;
        this.$message.success("认证成功！")
      }
    },
    handleLogin() {
      this.captchaVisible = true;
    }
  }
};
</script>
